package flc.ast.fragment;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import flc.ast.R;
import flc.ast.activity.AgeCalculateActivity;
import flc.ast.activity.DateCalculateActivity;
import flc.ast.activity.DayCalculateActivity;
import flc.ast.activity.LengthConversionActivity;
import flc.ast.activity.TimeCalculateActivity;
import flc.ast.activity.TimeConversionActivity;
import flc.ast.activity.TimeDiffCalculateActivity;
import flc.ast.activity.VolumeConversionActivity;
import flc.ast.activity.WorkDayCalculateActivity;
import flc.ast.databinding.FragmentToolBinding;
import stark.common.basic.base.BaseNoModelFragment;
import stark.common.basic.event.EventStatProxy;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link ToolFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class ToolFragment extends BaseNoModelFragment<FragmentToolBinding> {


    @Override
    protected int onCreate() {
        return R.layout.fragment_tool;
    }

    @Override
    protected void initView() {
        EventStatProxy.getInstance().statEvent1(getActivity(), mDataBinding.event1Container);

        mDataBinding.llTimeCalculate.setOnClickListener(this);
        mDataBinding.llAgeCalculate.setOnClickListener(this);
        mDataBinding.llTimeConversion.setOnClickListener(this);
        mDataBinding.llDateCalculate.setOnClickListener(this);
        mDataBinding.llDayCalculate.setOnClickListener(this);
        mDataBinding.llWorkDayCalculate.setOnClickListener(this);
        mDataBinding.llTimeDiffCalculate.setOnClickListener(this);
        mDataBinding.llLengthConversion.setOnClickListener(this);
        mDataBinding.llVolumeConversion.setOnClickListener(this);
    }

    @Override
    protected void onClickCallback(View v) {
        switch (v.getId()) {
            case R.id.llTimeCalculate://时间计算
                startActivity(TimeCalculateActivity.class);
                break;
            case R.id.llAgeCalculate://年龄计算
                startActivity(AgeCalculateActivity.class);
                break;
            case R.id.llTimeConversion://时间换算
                startActivity(TimeConversionActivity.class);
                break;
            case R.id.llDateCalculate://日期计算
                startActivity(DateCalculateActivity.class);
                break;
            case R.id.llDayCalculate://天数计算
                startActivity(DayCalculateActivity.class);
                break;
            case R.id.llWorkDayCalculate://工作日计算
                startActivity(WorkDayCalculateActivity.class);
                break;
            case R.id.llTimeDiffCalculate://时间差计算
                startActivity(TimeDiffCalculateActivity.class);
                break;
            case R.id.llLengthConversion://长度换算
                startActivity(LengthConversionActivity.class);
                break;
            case R.id.llVolumeConversion://体积换算
                startActivity(VolumeConversionActivity.class);
                break;
        }
    }

    @Override
    protected void initData() {

    }
}